//
//  OrderHeaderCell.m
//  PigMarket
//
//  Created by 张敬 on 2019/8/19.
//  Copyright © 2019年 pigmarket.oc. All rights reserved.
//

#import "MeatOrderHeaderCell.h"

@implementation MeatOrderHeaderCell


#pragma mark - lifecycle methods

- (void)setupUI{
    
    [self addSubview:self.titlelab];
    [self addSubview:self.moreBtn];
}

- (void)setupLayout{
    
    {
        _titlelab.size = CGSizeMake(KScreenWidth - 100, 21);
        _titlelab.mj_x = _titlelab.mj_y = 15;
    }
    
    {
        _moreBtn.size = CGSizeMake(34, 16);
        _moreBtn.mj_y = (51 - _moreBtn.height)/2.0;
        _moreBtn.mj_x = KScreenWidth - 45 - _moreBtn.width;
    }
    
    NSMutableAttributedString *atttibutedStr = [@"购买人：竹林双子猫" createAttributingByIcon:@"address_tip" downIndexImage:nil textColor:UIColorFromRGB(0x333333) font:mFont(15)];
    _titlelab.attributedText = atttibutedStr;
}


#pragma mark - setter methods

#pragma mark - getter methods

- (UILabel *)titlelab{
    
    if (!_titlelab) {
        _titlelab = [UILabel new];
    }
    return _titlelab;
}

- (UIButton *)moreBtn{
    
    if (!_moreBtn) {
        _moreBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        [_moreBtn setImage:[UIImage imageNamed:@"meat_operation"] forState:UIControlStateNormal];
        
        @weakify(self);
        _moreBtn.tapBlock = ^{
            @strongify(self);
            if (self.dealOperationBlock) {
                self.dealOperationBlock();
            }
        };
        
    }
    return _moreBtn;
}



@end
